Video encoding/decoding method and device

ABSTRACT

A video encoding/decoding device according to the present invention may determine an intra prediction mode of a current block on the basis of a most probable mode (MPM) of the current block or an intra prediction mode of a neighboring block, determine a reference region for intra prediction of the current block, and perform intra prediction on the current block by using the intra prediction mode and the reference region.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a U.S. National Stage Application of InternationalApplication No. PCT/KR2019/017479, filed on Dec. 11, 2019, which claimsthe benefit under 35 USC 119(a) and 365(b) of Korean Patent ApplicationNo. 10-2018-0163526, filed on Dec. 17, 2018, in the Korean IntellectualProperty Office, the entire disclosure of which is incorporated hereinby reference for all purposes.

TECHNICAL FIELD

The present disclosure relates to a method and a device ofencoding/decoding a video signal.

BACKGROUND ART

The demands for high-resolution and high-quality images have increasedin a variety of application fields. As image data becomeshigh-resolution and high-quality, the volume of data relativelyincreases compared to the existing image data, so when image data istransmitted by using media such as the existing wire and wirelessbroadband circuit or is stored by using the existing storage medium,expenses for transmission and expenses for storage increase. Highefficiency image compression technologies may be utilized to resolvethese problems which are generated as image data becomes high-resolutionand high-quality.

DISCLOSURE Technical Problem

The present disclosure is to improve encoding/decoding efficiency ofintra prediction.

The present disclosure is to improve encoding/decoding efficiency of anintra prediction mode.

Technical Solution

A video signal decoding method and device according to the presentdisclosure may obtain a flag from a bitstream, determine a candidategroup on an intra prediction mode of the current block based on theflag, derive an intra prediction mode of the current block based on thedetermined candidate group and perform intra prediction for the currentblock based on the derived intra prediction mode and a predeterminedreference region.

In a video signal decoding method and device according to the presentdisclosure, the flag may indicate a predetermined candidate group usedto derive an intra prediction mode of a current block.

In a video signal decoding method and device according to the presentdisclosure, the candidate group may be determined as a first candidategroup or a second candidate group, the first candidate group may beconfigured with a default mode and the second candidate group may beconfigured by using an intra prediction mode of a neighboring blockadjacent to the current block.

In a video signal decoding method and device according to the presentdisclosure, the default mode may include at least one of a DC mode or aPlanar mode.

In a video signal decoding method and device according to the presentdisclosure, at least one candidate mode belonging to the secondcandidate group may be derived by adding or subtracting a value of n toor from an intra prediction mode of the neighboring block and n may be anatural number greater than or equal to 2.

In a video signal decoding method and device according to the presentdisclosure, the number of candidate modes belonging to the secondcandidate group may be m and m may be a natural number such as 1, 2, 3,4, 5, 6, or more.

In a video signal decoding method and device according to the presentdisclosure, the second candidate group may not include a default modeincluded in the first candidate group.

A video signal encoding method and device according to the presentdisclosure may determine an intra prediction mode of a current block,encode a flag for indicating a candidate group to which an intraprediction mode of the current block belongs and perform intraprediction for the current block based on an intra prediction mode ofthe current block and a predetermined reference region.

In a video signal encoding method and device according to the presentdisclosure, the candidate group may include at least one of a firstcandidate group or a second candidate group, the first candidate groupmay be configured with a default mode and the second candidate group maybe configured by using an intra prediction mode of a neighboring blockadjacent to the current block.

In a video signal encoding method and device according to the presentdisclosure, the default mode may include at least one of a DC mode or aPlanar mode.

In a video signal encoding method and device according to the presentdisclosure, at least one candidate mode belonging to the secondcandidate group may be derived by adding or subtracting a value of n toor from an intra prediction mode of the neighboring block and n may be anatural number greater than or equal to 2.

In a video signal encoding method and device according to the presentdisclosure, the number of candidate modes belonging to the secondcandidate group may be m and m may be a natural number such as 1, 2, 3,4, 5, 6, or more.

In a video signal encoding method and device according to the presentdisclosure, the second candidate group may not include a default modeincluded in the first candidate group.

A computer-readable recording medium according to the present disclosuremay include a data stream including encoding information encoded byintra prediction of a current block, the encoding information mayinclude a flag indicating a candidate group used to derive an intraprediction mode of the current block and a candidate group on an intraprediction mode of the current block may be determined as any one of afirst candidate group or a second candidate group according to the flag.

In a computer-readable recording medium according to the presentdisclosure, the first candidate group may be configured with a defaultmode and the second candidate group may be configured by using an intraprediction mode of a neighboring block adjacent to the current block.

In a computer-readable recording medium according to the presentdisclosure, the default mode may include at least one of a DC mode or aPlanar mode.

In a computer-readable recording medium according to the presentdisclosure, at least one candidate mode belonging to the secondcandidate group may be derived by adding or subtracting a value of n toor from an intra prediction mode of the neighboring block and n may be anatural number greater than or equal to 2.

In a computer-readable recording medium according to the presentdisclosure, the number of candidate modes belonging to the secondcandidate group may be m and m may be a natural number such as 1, 2, 3,4, 5, 6, or more.

In a computer-readable recording medium according to the presentdisclosure, the second candidate group may not include a default modeincluded in the first candidate group.

Advantageous Effects

According to the present disclosure, encoding/decoding efficiency of anintra prediction mode may be improved by selectively using any one of aplurality of candidate groups.

In addition, according to the present disclosure, encoding/decodingefficiency of an intra prediction mode may be improved by reducing thenumber of non-MPMs or changing arrangement of non-MPMs.

In addition, according to the present disclosure, encoding/decodingefficiency of intra prediction may be improved by determining apredetermined reference region for intra prediction.

DESCRIPTION OF DRAWINGS

FIG. 1 shows a rough block diagram of an encoding device as anembodiment of the present disclosure.

FIG. 2 shows a rough block diagram of an decoding device as anembodiment of the present disclosure.

FIG. 3 shows an intra prediction method as an embodiment to which thepresent disclosure is applied.

FIGS. 4A-4B and 5 show a method in which a second candidate group isdetermined as an embodiment to which the present disclosure is applied.

FIG. 6 relates to a method in which remaining mode information isencoded/decoded based on removal of a second candidate group as anembodiment to which the present disclosure is applied.

FIG. 7 relates to a method in which remaining mode information isencoded/decoded based on rearrangement of a second candidate group as anembodiment to which the present disclosure is applied.

BEST MODE

A video signal decoding method and device according to the presentdisclosure may obtain a flag from a bitstream, determine a candidategroup on an intra prediction mode of the current block based on theflag, derive an intra prediction mode of the current block based on thedetermined candidate group and perform intra prediction for the currentblock based on the derived intra prediction mode and a predeterminedreference region.

In a video signal decoding method and device according to the presentdisclosure, the flag may indicate a predetermined candidate group usedto derive an intra prediction mode of a current block.

In a video signal decoding method and device according to the presentdisclosure, the candidate group may be determined as a first candidategroup or a second candidate group, the first candidate group may beconfigured with a default mode and the second candidate group may beconfigured by using an intra prediction mode of a neighboring blockadjacent to the current block.

In a video signal decoding method and device according to the presentdisclosure, the default mode may include at least one of a DC mode or aPlanar mode.

In a video signal decoding method and device according to the presentdisclosure, at least one candidate mode belonging to the secondcandidate group may be derived by adding or subtracting a value of n toor from an intra prediction mode of the neighboring block and n may be anatural number greater than or equal to 2.

In a video signal decoding method and device according to the presentdisclosure, the number of candidate modes belonging to the secondcandidate group may be m and m may be a natural number such as 1, 2, 3,4, 5, 6, or more.

In a video signal decoding method and device according to the presentdisclosure, the second candidate group may not include a default modeincluded in the first candidate group.

A video signal encoding method and device according to the presentdisclosure may determine an intra prediction mode of a current block,encode a flag for indicating a candidate group to which an intraprediction mode of the current block belongs and perform intraprediction for the current block based on an intra prediction mode ofthe current block and a predetermined reference region.

In a video signal encoding method and device according to the presentdisclosure, the candidate group may include at least one of a firstcandidate group or a second candidate group, the first candidate groupmay be configured with a default mode and the second candidate group maybe configured by using an intra prediction mode of a neighboring blockadjacent to the current block.

In a video signal encoding method and device according to the presentdisclosure, the default mode may include at least one of a DC mode or aPlanar mode.

In a video signal encoding method and device according to the presentdisclosure, at least one candidate mode belonging to the secondcandidate group may be derived by adding or subtracting a value of n toor from an intra prediction mode of the neighboring block and n may be anatural number greater than or equal to 2.

In a video signal encoding method and device according to the presentdisclosure, the number of candidate modes belonging to the secondcandidate group may be m and m may be a natural number such as 1, 2, 3,4, 5, 6, or more.

In a video signal encoding method and device according to the presentdisclosure, the second candidate group may not include a default modeincluded in the first candidate group.

A computer-readable recording medium according to the present disclosuremay include a data stream including encoding information encoded byintra prediction of a current block, but the encoding information mayinclude a flag indicating a candidate group used to derive an intraprediction mode of the current block and a candidate group on an intraprediction mode of the current block may be determined as any one of afirst candidate group or a second candidate group according to the flag.

In a computer-readable recording medium according to the presentdisclosure, the first candidate group may be configured with a defaultmode and the second candidate group may be configured by using an intraprediction mode of a neighboring block adjacent to the current block.

In a computer-readable recording medium according to the presentdisclosure, the default mode may include at least one of a DC mode or aPlanar mode.

In a computer-readable recording medium according to the presentdisclosure, at least one candidate mode belonging to the secondcandidate group may be derived by adding or subtracting a value of n toor from an intra prediction mode of the neighboring block and n may be anatural number greater than or equal to 2.

In a computer-readable recording medium according to the presentdisclosure, the number of candidate modes belonging to the secondcandidate group may be m and m may be a natural number such as 1, 2, 3,4, 5, 6, or more.

In a computer-readable recording medium according to the presentdisclosure, the second candidate group may not include a default modeincluded in the first candidate group.

MODE FOR INVENTION

As the present disclosure may make various changes and have severalembodiments, specific embodiments will be illustrated in a drawing anddescribed in detail. But, it is not intended to limit the presentdisclosure to a specific embodiment, and it should be understood that itincludes all changes, equivalents or substitutes included in an idea anda technical range of the present disclosure. A similar reference sign isused for a similar component while explaining each drawing.

A term such as first, second, etc. may be used to describe variouscomponents, but the components should not be limited by the terms. Theterms are used only to distinguish one component from other components.For example, without going beyond a scope of a right of the presentdisclosure, a first component may be referred to as a second componentand similarly, a second component may be also referred to as a firstcomponent. A term, and/or, includes a combination of a plurality ofrelative entered items or any item of a plurality of relative entereditems.

When a component is referred to as being “linked” or “connected” toother component, it should be understood that it may be directly linkedor connected to other component, but other component may exist in themiddle. On the other hand, when a component is referred to as being“directly linked” or “directly connected” to other component, it shouldbe understood that other component does not exist in the middle.

As terms used in this application are only used to describe a specificembodiment, they are not intended to limit the present disclosure.Expression of the singular includes expression of the plural unless itclearly has a different meaning contextually. In this application, itshould be understood that a term such as “include” or “have”, etc. is todesignate the existence of characteristics, numbers, stages, motions,components, parts or their combinations entered in a specification, butis not to exclude the existence or possibility of addition of one ormore other characteristics, numbers, stages, motions, components, partsor their combinations in advance.

Hereinafter, referring to the attached drawings, a desirable embodimentof the present disclosure will be described in more detail. Hereinafter,the same reference sign is used for the same component in a drawing andan overlapping description for the same component is omitted.

FIG. 1 shows a rough block diagram of an encoding device as anembodiment of the present disclosure.

In reference to FIG. 1, an encoding device 100 may include a picturepartition unit 110, a prediction unit 120, 125, a transform unit 130, aquantization unit 135, a rearrangement unit 160, an entropy encodingunit 165, a dequantization unit 140, an inverse transform unit 145, afilter unit 150 and a memory 155.

As each construction unit shown in FIG. 1 is independently shown torepresent different characteristic functions in a video encoding device,it may mean that each construction unit is configured with a separatedhardware. But, as each construction unit is included by being enumeratedas each construction unit for convenience of description, at least twoconstruction units among each construction unit may be combined toconfigure one construction unit or one construction unit may be dividedinto a plurality of construction units to perform a function and such anintegrated embodiment and separated embodiment of each construction unitare also included in a scope of a right of the present disclosure aslong as they are not beyond the essence of the present disclosure.

In addition, some components may be just a selective component forimproving performance, not an essential component performing anessential function in the present disclosure. The present disclosure maybe implemented by including only a construction unit necessary forembodying the essence of the present disclosure excluding a componentused only for performance improvement and a structure including only anessential component excluding a selective component used only forperformance improvement is also included in a scope of a right of thepresent disclosure.

A picture partition unit 110 may partition an input picture into atleast one block. In this case, a block may mean a coding unit (CU), aprediction unit (PU) or a transform unit (TU). The coding unit (CU) maybe set the same as a prediction unit (PU) and/or a transform unit (TU).Alternatively, one coding unit (CU) may be partitioned into a pluralityof prediction units (PU) or transform units (TU). One prediction unit(PU) may be partitioned into/configured with a plurality of transformunits (TU). Conversely, one transform unit (TU) may be partitionedinto/configured with a plurality of prediction units (PU).

The partitioning may be performed based on at least one of quad tree,binary tree or triple tree. Quad tree is a method in which a higherblock is partitioned into 4 lower blocks that a width and a height arehalf of a higher block. Binary tree is a method in which a higher blockis partitioned into 2 lower blocks that any one of a width or a heightis half of a higher block. In binary tree, a block may have a non-squareshape as well as a square shape through the above-described binarytree-based partitioning.

Hereinafter, in an embodiment of the present disclosure, a coding unitmay be used as a unit performing encoding or may be used as a unitperforming decoding.

A prediction unit 120 and 125 may include an inter prediction unit 120performing inter prediction and an intra prediction unit 125 performingintra prediction. Whether to perform inter prediction or intraprediction for a prediction unit may be determined and concreteinformation (e.g., an intra prediction mode, a motion vector, areference picture, etc.) according to each prediction method may bedetermined. In this case, a processing unit that prediction is performedmay be different from a processing unit that a prediction method andconcrete contents are determined. For example, a prediction method, aprediction mode, etc. may be determined in a prediction unit andprediction may be performed in a transform unit. A residual value (aresidual block) between a generated prediction block and an originalblock may be input into a transform unit 130. In addition, predictionmode information, motion vector information, etc. used for predictionmay be encoded in an entropy encoding unit 165 together with a residualvalue and transmitted to a decoding device. When a specific encodingmode is used, it is possible to encode an original block as it is andtransmit it to a decoding unit without generating a prediction blockthrough a prediction unit 120 and 125.

An inter prediction unit 120 may predict a prediction unit based oninformation of at least one picture of a previous picture or asubsequent picture of a current picture or may predict a prediction unitbased on information of some regions which have been encoded in acurrent picture in some cases. An inter prediction unit 120 may includea reference picture interpolation unit, a motion prediction unit and amotion compensation unit.

In a reference picture interpolation unit, reference picture informationmay be provided from a memory 155 and pixel information equal to or lessthan an integer pixel may be generated in a reference picture. For aluma pixel, a DCT-based 8-tap interpolation filter with different filtercoefficients may be used to generate pixel information equal to or lessthan an integer pixel in a ¼ pixel unit. For a chroma signal, aDCT-based 4-tap interpolation filter with different filter coefficientsmay be used to generate pixel information equal to or less than aninteger pixel in a ⅛ pixel unit.

A motion prediction unit may perform motion prediction based on areference picture interpolated by a reference picture interpolationunit. As a method for calculating a motion vector, various methods suchas FBMA (Full search-based Block Matching Algorithm), TSS (Three StepSearch), NTS(New Three-Step Search Algorithm), etc. may be used. Amotion vector may have a motion vector value in a ½ or ¼ pixel unitbased on an interpolated pixel. In a motion prediction unit, a currentprediction unit may be predicted by making a motion prediction methoddifferent. As a motion prediction method, various methods such as a skipmethod, a merge method, an AMVP (Advanced Motion Vector Prediction)method, etc. may be used.

An intra prediction unit 125 may generate a prediction unit based onreference pixel information around a current block that is pixelinformation in a current picture. When a reference pixel is a pixelwhich performs inter prediction as a peripheral block of a currentprediction unit is a block which performs inter prediction, a referencepixel included in a block which performs inter prediction may be used bybeing substituted with reference pixel information of a peripheral blockwhich performs intra prediction. In other words, when a reference pixelis unavailable, unavailable reference pixel information may be used bybeing substituted with at least one reference pixel of availablereference pixels.

In intra prediction, a prediction mode may have a directional predictionmode which uses reference pixel information according to a predictiondirection and a nondirectional mode which does not use directionalinformation when prediction is performed. A mode for predicting lumainformation may be different from a mode for predicting chromainformation and intra prediction mode information used to predict lumainformation or predicted luma signal information may be utilized topredict chroma information.

An intra prediction method may generate a prediction block after an AIS(Adaptive Intra Smoothing) filter is applied to a reference pixelaccording to a prediction mode. A type of an AIS filer applied to areference pixel may be different. An intra prediction mode of a currentprediction unit may be predicted from an intra prediction mode of aprediction unit around a current prediction unit to perform an intraprediction method. When a prediction mode of a current prediction unitis predicted by using mode information predicted from a peripheralprediction unit, information that a prediction mode of a currentprediction unit is the same as that of a peripheral prediction unit maybe transmitted by using predetermined flag information if an intraprediction mode of a current prediction unit is the same as that of aperipheral prediction unit. Prediction mode information of a currentblock may be encoded by performing entropy encoding if a prediction modeof a current prediction unit is different from that of a peripheralprediction unit.

In addition, a residual block including residual value information, adifference value between a prediction unit which performs predictionbased on a prediction unit generated in a prediction unit 120 and 125and an original block of a prediction unit, may be generated. Agenerated residual block may be input into a transform unit 130.

A transform unit 130 may transform a residual block including residualdata by using a transform type such as DCT, DST, etc. In this case, atransform method may be determined based on an intra prediction mode ofa prediction unit used to generate a residual block.

A quantization unit 135 may quantize values which are transformed into afrequency domain in a transform unit 130. According to a block oraccording to image importance, a quantization coefficient may bechanged. A value calculated in a quantization unit 135 may be providedto a dequantization unit 140 and a rearrangement unit 160.

A rearrangement unit 160 may perform rearrangement of a coefficientvalue for a quantized residual value.

A rearrangement unit 160 may change two-dimensional block-shapedcoefficients into a one-dimensional vector shape through a coefficientscanning method. For example, in a rearrangement unit 160, a DCcoefficient to a coefficient in a high frequency domain may be scannedby using a predetermined scanning type and may be changed into aone-dimensional vector shape.

An entropy encoding unit 165 may perform entropy encoding based onvalues calculated by a rearrangement unit 160. For example, entropyencoding may use various encoding methods such as Exponential Golomb,CAVLC(Context-Adaptive Variable Length Coding), CABAC(Context-AdaptiveBinary Arithmetic Coding).

An entropy encoding unit 165 may encode various information such asresidual value coefficient information and block type information of acoding unit, prediction mode information, partitioning unit information,prediction unit information and transmission unit information, motionvector information, reference frame information, interpolationinformation of a block, filtering information, etc. from a rearrangementunit 160 and a prediction unit 120 and 125.

In an entropy encoding unit 165, a coefficient value of a coding unitinput in a rearrangement unit 160 may be entropy-encoded.

In a dequantization unit 140 and an inverse transform unit 145, valuesquantized in a quantization unit 135 are dequantized and valuestransformed in a transform unit 130 are inverse-transformed. Areconstructed block may be generated by combining a residual valuegenerated in a dequantization unit 140 and an inverse transform unit 145with a prediction unit which is predicted through a motion predictionunit, a motion compensation unit and an intra prediction unit includedin a prediction unit 120 and 125.

A filter unit 150 may include at least one of a deblocking filter, anoffset modification unit or ALF (Adaptive Loop Filter).

A deblocking filter may remove block distortion generated by a boundarybetween blocks in a reconstructed picture. Whether a deblocking filterwill be applied to a current block may be determined based on a pixelincluded in several columns or rows included in a block in order todetermine whether deblocking is performed. When a deblocking filter isapplied to a block, a strong filter or a weak filter may be appliedaccording to strength of necessary deblocking filtering. In addition, inapplying a deblocking filter, horizontal directional filtering andvertical directional filtering may be processed in parallel whenvertical filtering and horizontal filtering are performed.

An offset modification unit may modify an offset with an original imagein a pixel unit for an image performing deblocking. A method in which apixel included in an image is divided into the certain number ofregions, a region which will perform an offset is determined and anoffset is applied to the corresponding region or a method in which anoffset is applied by considering edge information of each pixel may beused to perform offset modification for a specific picture.

ALF (Adaptive Loop Filter) may be performed based on a value obtained bycomparing a filtered reconstructed image with an original image. Pixelsincluded in an image may be divided into a predetermined group, onefilter to be applied to the corresponding group may be determined andfiltering may be performed discriminately per group. Information relatedto whether ALF is applied may be transmitted per coding unit (CU) for aluma signal and a shape and a filter coefficient of an ALF filter to beapplied may be different according to each block. In addition, an ALFfilter of the same shape (fixed shape) may be applied regardless of afeature of a target block to be applied.

A memory 155 may store a reconstructed block or picture calculated in afilter unit 150 and a stored reconstructed block or picture may beprovided to a prediction unit 120 and 125 when inter prediction isperformed.

FIG. 2 shows a rough block diagram of an decoding device as anembodiment of the present disclosure.

In reference to FIG. 2, a decoding device 200 may include an entropydecoding unit 210, a rearrangement unit 215, a dequantization unit 220,an inverse transform unit 225, a prediction unit 230 and 235, a filterunit 240 and a memory 245.

As each construction unit shown in FIG. 2 is independently shown torepresent different characteristic functions in a decoding device, itmay mean that each construction unit is configured with a separatedhardware. But, as each construction unit is included by being enumeratedas each construction unit for convenience of description, at least twoconstruction units among each construction unit may be combined toconfigure one construction unit or one construction unit may be dividedinto a plurality of construction units to perform a function and such anintegrated embodiment and separated embodiment of each construction unitare also included in a scope of a right of the present disclosure aslong as they are not beyond the essence of the present disclosure.

An entropy decoding unit 210 may perform entropy decoding for an inputbitstream. For example, for entropy decoding, various methods such asExponential Golomb, CAVLC(Context-Adaptive Variable Length Coding) andCABAC(Context-Adaptive Binary Arithmetic Coding) may be applied.

In an entropy decoding unit 210, information related to intra predictionand inter prediction performed in an encoding device may be decoded.

A rearrangement unit 215 may perform rearrangement for a bitstreamentropy-decoded in an entropy decoding unit 210. Coefficientsrepresented in a one-dimensional vector shape may be rearranged byreconstructing into coefficients in a two-dimensional block shape. In arearrangement unit 215, information related to coefficient scanningperformed in an encoding device may be provided and rearrangement may beperformed in an inverse scanning method based on a scanning orderperformed in the corresponding encoding device.

A dequantization unit 220 may perform dequantization based on aquantization parameter and a coefficient value of a rearranged block.

An inverse transform unit 225 may perform inverse-transform on adequantized transform coefficient in a predetermined transform method.In this case, a transform method may be determined based on informationon a prediction method (inter/intra prediction), a size/a shape of ablock, an intra prediction mode, etc.

A prediction unit 230 and 235 may generate a prediction block based oninformation related to prediction block generation provided in anentropy decoding unit 210 and pre-decoded block or picture informationprovided in a memory 245.

A prediction unit 230 and 235 may include a prediction unitdetermination unit, an inter prediction unit and an intra predictionunit. A prediction unit determination unit may receive a variety ofinformation such as prediction unit information, prediction modeinformation of an intra prediction method, information related to motionprediction of an inter prediction method, etc. which are input from anentropy decoding unit 210, distinguish a prediction unit from a currentcoding unit (CU) and determine whether a prediction unit performs interprediction or intra prediction. An inter prediction unit 230 may performinter prediction on a current prediction unit based on informationincluded in at least one picture of a previous picture or a subsequentpicture of a current picture that a current prediction unit is included,by using information necessary for inter prediction of a currentprediction unit provided by an encoding device. Alternatively, interprediction may be performed based on information of some regions whichare pre-reconstructed in a current picture that a current predictionunit is included.

To perform inter prediction, whether a motion prediction method of aprediction unit included in a corresponding coding unit is a skip mode,a merge mode or a AMVP mode may be determined in a coding unit.

An intra prediction unit 235 may generate a prediction block based onpixel information in a current picture. When a prediction unit is aprediction unit which performs intra prediction, intra prediction may beperformed based on intra prediction mode information of a predictionunit provided by an encoding device. An intra prediction unit 235 mayinclude an AIS (adaptive intra smoothing) filter, a reference pixelinterpolation unit and a DC filter. An AIS filter is a part performingfiltering for a reference pixel of a current block and may be applied bydetermining whether a filter is applied according to a prediction modeof a current prediction unit. AIS filtering may be performed for areference pixel of a current block by using a prediction mode of aprediction unit and AIS filter information provided by an encodingdevice. When a prediction mode of a current block is a mode where AISfiltering is not performed, an AIS filter may not be applied.

When a prediction mode of a prediction unit is a prediction unit inwhich intra prediction is performed based on a pixel value interpolatinga reference pixel, a reference pixel interpolation unit may interpolatea reference pixel to generate a reference pixel in a pixel unit which isequal to or less than an integer value. When a prediction mode of acurrent prediction unit is a prediction mode which generates aprediction block without interpolating a reference pixel, a referencepixel may not be interpolated. A DC filter may generate a predictionblock through filtering when a prediction mode of a current block is aDC mode.

A reconstructed block or picture may be provided to a filter unit 240. Afilter unit 240 may include a deblocking filter, an offset modificationunit and an ALF.

Information on whether a deblocking filter is applied to a correspondingblock or picture and information on whether a strong filter or a weakfilter is applied when a deblocking filter is applied may be provided byan encoding device. A deblocking filter of a decoding device may receiveinformation related to a deblocking filter provided by an encodingdevice and perform deblocking filtering for a corresponding block in adecoding device.

An offset modification unit may perform offset modification on areconstructed image based on a type of offset modification, offset valueinformation, etc. applied to an image in encoding.

An ALF may be applied to a coding unit based on information on whetheran ALF is applied, ALF coefficient information, etc. provided by anencoder. Such ALF information may be provided by being included in aspecific parameter set.

A memory 245 may store a reconstructed picture or block for use as areference picture or a reference block and also provide a reconstructedpicture to an output unit.

FIG. 3 shows an intra prediction method as an embodiment to which thepresent disclosure is applied.

In reference to FIG. 3, an intra prediction mode of a current block maybe determined 5300.

Concretely, a decoding device may obtain a first flag from a bitstream.The first flag may represent whether an intra prediction mode of acurrent block is derived from a candidate mode list (a first candidategroup). A candidate mode list may include k candidate modes (MPM) and kmay be an integer such as 1, 2, 3, 4, 5, 6, or more.

When the first flag is a first value (i.e., when an intra predictionmode of a current block is derived from a first candidate group), adecoding device may obtain index information (mpm_idx) from a bitstream.In this case, index information may specify any one of a plurality ofMPM belonging to the candidate mode list. An intra prediction mode of acurrent block may be determined based on the candidate mode list andindex information. In other words, a MPM specified by the indexinformation may be set as an intra prediction mode of a current block.But, index information may be used only when a plurality of MPM areincluded in a candidate mode list. For example, when only one MPM isincluded in a candidate mode list, signaling of index information may beomitted and the corresponding MPM may be set as an intra prediction modeof a current block.

The MPM may be determined by using a neighboring block of a currentblock. The neighboring block may mean a block which is adjacent to atleast one of a left, a top, a top-left, a top-right or a bottom-right ofa current block. The number of the neighboring blocks may be 1, 2, 3, 4,5, or more. The number may be the fixed number which is predefined in anencoding/decoding device. The number may be variably determined based ona predetermined encoding parameter. The encoding parameter may includeinformation on a block attribute. Herein, a block attribute may mean aposition, a size, a shape, a ratio of a width and a height, a lengthvalue of a width and a height, a partitioning method (e.g., Quadtree,Binary tree, Ternary tree), a partitioning depth, a value of an intraprediction mode, whether an intra prediction mode is a directional mode,an angle of an intra prediction mode, a component type (luma, chroma),etc. Alternatively, the number may be encoded and signaled in anencoding device. The signaling may be performed in a level of at leastone of a video sequence, a picture, a slice, a tile or a predeterminedpartial region (e.g., CTU row, CTU, CU, PU, etc.).

The MPM may be determined based on at least one of (A) whether an intraprediction mode between the above-described neighboring blocks is thesame, (B) whether an intra prediction mode of a neighboring block is adirectional mode, (C) whether an intra prediction mode of a firstneighboring block is greater than an intra prediction mode of a secondneighboring block, (D) whether a difference between intra predictionmodes between neighboring blocks is the same as a predeterminedthreshold value or (E) a position of a reference line for intraprediction of a current block. The threshold value may be an arbitrarynatural number belonging to a range from 1 to (NumIntraAngMode−1).NumIntraAngMode means the total number of directional modes which arepredefined in an encoding/decoding device, which may be 65.

The MPM may be configured with at least one of an intra prediction modeof one or more neighboring blocks, a mode derived by adding orsubtracting a value of n to or from an intra prediction mode of aneighboring block, or a default mode. Herein, a value of n may be aninteger such as 1, 2, 3, or more. A value of n may be variablydetermined based on at least one of the above-described (A) to (D). Thedefault mode may include at least one of a Planar mode or a DC mode.

Hereinafter, for convenience of description, a method in which 6 MPM aredetermined by using 2 neighboring blocks, a top block and a left block,will be described. An intra prediction mode of a top block and an intraprediction mode of a left block are referred to as intraPredModeA andintraPredModeL, respectively.

1. When intraPredModeL and intraPredModeA are the Same

The MPM of a current block may include intraPredModeL, a default mode, amode derived by subtracting 1 from intraPredModeL, a mode derived byadding 1 to intraPredModeL and a mode derived by adding or subtracting 2to or from intraPredModeL. An index may be assigned to the MPM based ona predetermined priority. For example, an index may be assigned to eachMPM as in the following Table 1. But, a priority of the presentdisclosure is not limited to Table 1 and a position of a MPM in acandidate mode list may be different from Table 1.

TABLE 1 mpm[0] intraPredModeL mpm[1] PLANAR mpm[2] DC mpm[3] 2 +((intraPredModeL + 62)%65) mpm[4] 2 + ((intraPredModeL − 1)%65) mpm[5]2 + ((intraPredModeL + 61)%65)

2. When intraPredModeL and intraPredModeA are Different

(1) When Both intraPredModeL and intraPredModeA are Directional Modes,intraPredModeL is Greater than intraPredModeA and a Difference BetweenintraPredModeL and intraPredModeA is not 1 or 64

The MPM of a current block may include intraPredModeL, intraPredModeA, adefault mode, a mode derived by subtracting 1 from intraPredModeL and amode derived by adding 1 to intraPredModeL. An index may be assigned tothe MPM based on a predetermined priority. For example, an index may beassigned to each MPM as in the following Table 2. But, a priority of thepresent disclosure is not limited to Table 2 and a position of a MPM ina candidate mode list may be different from Table 2.

TABLE 2 mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] PLANAR mpm[3]DC mpm[4] 2 + ((intraPredModeL + 62)%65) mpm[5] 2 + ((intraPredModeL −1)%65)(2) When Both intraPredModeL and intraPredModeA are Directional Modes,intraPredModeL is Greater than intraPredModeA and a Difference BetweenintraPredModeL and intraPredModeA is 1 or 64

The MPM of a current block may include intraPredModeL, intraPredModeA,and a default mode. The MPM of a current block may additionally includeat least one of a mode derived by subtracting 1 from intraPredModeL, amode derived by adding 1 to intraPredModeL, a mode derived bysubtracting 2 from intraPredModeL or a mode derived by adding 2 tointraPredModeL. When the mode derived by subtracting or adding 1 from orto intraPredModeL is the same as intraPredModeA, it may be excluded froma MPM. In this case, the mode derived by subtracting or adding 2 from orto intraPredModeL may be added/included as a MPM.

An index may be assigned to the MPM based on a predetermined priority.For example, an index may be assigned to each MPM as in the followingTable 3. But, a priority of the present disclosure is not limited toTable 3 and a position of a MPM in a candidate mode list may bedifferent from Table 3.

TABLE 3 mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] PLANAR mpm[3]DC mpm[4] 2 + ((intraPredModeL + 61)%65) mpm[5] 2 +((intraPredModeL)%65)(3) When Both intraPredModeL and intraPredModeA are Directional Modes,intraPredModeL is Less than intraPredModeA and a Difference BetweenintraPredModeL and intraPredModeA is not 1 or 64

The MPM of a current block may include intraPredModeL, intraPredModeA, adefault mode, a mode derived by subtracting 1 from intraPredModeA and amode derived by adding 1 to intraPredModeA. An index may be assigned tothe MPM based on a predetermined priority. For example, an index may beassigned to each MPM as in the following Table 4. But, a priority of thepresent disclosure is not limited to Table 4 and a position of a MPM ina candidate mode list may be different from Table 4.

TABLE 4 mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] PLANAR mpm[3]DC mpm[4] 2 + ((intraPredModeA + 62)%65) mpm[5] 2 + ((intraPredModeA −1)%65)(4) When Both intraPredModeL and intraPredModeA are Directional Modes,intraPredModeL is Less than intraPredModeA and a Difference BetweenintraPredModeL and intraPredModeA is 1 or 64

The MPM of a current block may include intraPredModeL, intraPredModeA,and a default mode. The MPM of a current block may additionally includeat least one of a mode derived by subtracting 1 from intraPredModeA, amode derived by adding 1 to intraPredModeA, a mode derived bysubtracting 2 from intraPredModeA or a mode derived by adding 2 tointraPredModeA. When the mode derived by subtracting or adding 1 from orto intraPredModeA is the same as intraPredModeL, it may be excluded froma MPM. In this case, a mode derived by subtracting or adding 2 from orto intraPredModeA may be added/included as a MPM.

An index may be assigned to the MPM based on a predetermined priority.For example, an index may be assigned to each MPM as in the followingTable 5. But, a priority of the present disclosure is not limited toTable 5 and a position of a MPM in a candidate mode list may bedifferent from Table 5.

TABLE 5 mpm[0] intraPredModeL mpm[1] intraPredModeA mpm[2] PLANAR mpm[3]DC mpm[4] 2 + ((intraPredModeA + 61)%65) mpm[5] 2 +((intraPredModeA)%65)(5) When any One of intraPredModeL and intraPredModeA is a DirectionalMode and the Other is a DC Mode

The MPM of a current block may include a directional mode(intraPredModeX) of intraPredModeL or intraPredModeA, a default mode, amode derived by subtracting 1 from intraPredModeX, a mode derived byadding 1 to intraPredModeX and a mode derived by subtracting or adding 2from or to intraPredModeX.

An index may be assigned to the MPM based on a predetermined priority.For example, an index may be assigned to each MPM as in the followingTable 6. But, a priority of the present disclosure is not limited toTable 6 and a position of a MPM in a candidate mode list may bedifferent from Table 6. For example, DC may have a higher priority thanintraPredModeX. PLANAR may have a higher priority than DC. PLANAR mayhave a higher priority than intraPredModeX.

TABLE 6 mpm[0] intraPredModeX mpm[1] DC mpm[2] PLANAR mpm[3] 2 +((intraPredModeX + 62)%65) mpm[4] 2 + ((intraPredModeX − 1)%65) mpm[5]2 + ((intraPredModeX + 61)%65)(6) When any One of intraPredModeL and intraPredModeA is a DirectionalMode and the Other is a Planar Mode

The MPM of a current block may include a directional mode(intraPredModeX) of intraPredModeL or intraPredModeA, a default mode, amode derived by subtracting 1 from intraPredModeX, a mode derived byadding 1 to intraPredModeX and a mode derived by subtracting or adding 2from or to intraPredModeX.

An index may be assigned to the MPM based on a predetermined priority.For example, an index may be assigned to each MPM as in the followingTable 7. But, a priority of the present disclosure is not limited toTable 7 and a position of a MPM in a candidate mode list may bedifferent from Table 7. For example, PLANAR may have a higher prioritythan intraPredModeX. DC may have a higher priority than PLANAR. DC mayhave a higher priority than intraPredModeX.

TABLE 7 mpm[0] intraPredModeX mpm[1] PLANAR mpm[2] DC mpm[3] 2 +((intraPredModeX + 62)%65) mpm[4] 2 + ((intraPredModeX − 1)%65) mpm[5]2 + ((intraPredModeX + 61)%65)(7) When Both intraPredModeL and intraPredModeA are Nondirectional Modes

The MPM of a current block may include a default mode, a horizontal mode(intraPredModeH), and a vertical mode (intraPredModeV). In addition, theMPM of a current block may additionally include at least one of a modederived by subtracting or adding 1 from or to intraPredModeH or a modederived by subtracting or adding 1 from or to intraPredModeV.

An index may be assigned to the MPM based on a predetermined priority.For example, an index may be assigned to each MPM as in the followingTable 8. But, a priority of the present disclosure is not limited toTable 8 and a position of a MPM in a candidate mode list may bedifferent from Table 8.

TABLE 8 mpm[0] PLANAR mpm[1] DC mpm[2] 2 + ((intraPredModeH + 62)%65)mpm[3] 2 + ((intraPredModeH − 1)%65) mpm[4] 2 + ((intraPredModeV +62)%65) mpm[5] 2 + ((intraPredModeV − 1)%65)

Meanwhile, a MPM of a current block may be determined based on areference region which will be described after. When a reference regionof a current block is the k-th reference line, a nondirectional mode maybe used and otherwise, it may be restricted so that a nondirectionalmode is not used. When a current block is allowed to use a referenceline other than the k-th reference line, a nondirectional mode may notbe included in the MPM of a current block. k may be 1, 2, 3, or 4. Inthis case, in the above-described embodiments (1) to (7), anondirectional mode belonging to a MPM may be replaced with apredetermined intra prediction mode. Herein, a predetermined intraprediction mode may be at least one of an intra prediction mode of aneighboring block or a mode derived by adding/subtracting a value of nto/from an intra prediction mode of a neighboring block. n may be aninteger such as 1, 2, 3, or more. The addition/subtraction process maybe repeatably performed by increasing a value of n by 1 until acandidate mode list is configured with 6 MPM. But, the 6 is just anexample, and the maximum number of MPM configuring a candidate mode listmay be 3, 4, 5, 7, 8, 9, or more. The maximum number may be a fixedvalue which is pre-promised in an encoder/a decoder or may be variablydetermined based on an encoding parameter (e.g., information related toa block attribute, a position of a reference line, etc.).

When the first flag is a second value (i.e., when an intra predictionmode of a current block is not derived from a first candidate group), adecoding device may obtain remaining mode information from a bitstream.A decoding device may determine an intra prediction mode of a currentblock based on remaining mode information.

The remaining mode information may be encoded based on remaining modes(hereinafter referred to as non-MPM) other than the above-described MPMin intra prediction modes which are predefined in an encoding/decodingdevice. The predefined intra prediction modes may include 2nondirectional modes (a planar mode, a DC mode) and 65 directionalmodes. For example, an encoding device may generate remaining modeinformation by encoding a mode corresponding to an intra prediction modeof a current block among the non-MPM.

In the encoding, remaining mode information may be encoded based on atruncated binary coding method. When it is assumed that 67 intraprediction modes and 6 MPM are used, as in the following table, an intraprediction mode with an index of 0˜2 may be encoded with 5 bits and anintra prediction mode with an index of 3˜60 may be encoded with 6 bitsin 61 non-MPM. But, in the following table, the number of bits and thenumber of intra prediction modes encoded with 5 bits/6 bits may bevariably determined based on at least one of the number of predefinedintra prediction modes or the number of MPM. In addition, remaining modeinformation may be encoded based on FLC (fixed length code), VLC(variable length code), etc.

Input Offset Truncated value Offset value Binary 5-bits 0 0 0 00000

{open oversize bracket} 1 0 1 00001 2 0 2 00010 3 3 6 000110 4 3 7000111 • • • 6-bits {open oversize bracket} 57 3 60 111100

58 3 61 111101 59 3 62 111110 60 3 63 111111

Alternatively, the non-MPM may be classified into at least 2 or moregroups. For example, the non-MPM may include a second candidate groupand a third candidate group. When an intra prediction mode of a currentblock is not derived from a first candidate group, an intra predictionmode of a current block may be derived by selectively using any one of asecond candidate group or a third candidate group.

In this case, a second candidate group may be configured with a modederived based on a MPM and a third candidate group may be configuredwith remaining modes other than a second candidate group among thenon-MPM. Alternatively, a second candidate group may be configured basedon an intra prediction mode of a neighboring block and/or a modeneighboring an intra prediction mode of a neighboring block. In otherwords, a second candidate group may be derived in a method which is thesame as/similar to the above-described first candidate group, but asecond candidate group may not include a MPM belonging to a firstcandidate group. For example, a second candidate group may include atleast one of modes that a difference of a mode value with an intraprediction mode of a neighboring block is +1, −1, +2, −2, +3, −3, . . ., +L, −L and hereinafter, it will be described on the assumption that asecond candidate group is configured with 5 candidate modes. But, it isnot limited thereto and the number of candidate modes belonging to asecond candidate group may be an integer such as 1, 2, 3, 4, 6, or more.

Concretely, a second candidate group may be determined by considering atleast one of whether an intra prediction mode of a left block(candIntraPredModeA) and an intra prediction mode of a top block(candIntraPredModeB) are the same or whether candIntraPredModeA andcandIntraPredModeB are nondirectional modes.

For example, when candIntraPredModeA and candIntraPredModeB are the sameand candIntraPredModeA is not a nondirectional mode, a second candidategroup may include at least one of candIntraPredModeA,(candIntraPredModeA−n), (candIntraPredModeA+n) or a nondirectional mode.Herein, n may be an integer such as 1, 2, or more. The nondirectionalmode may include at least one of a Planar mode or a DC mode. In anexample, a candidate mode of a second candidate group may be determinedas in the following Table 9. An index in Table 9 specifies a position ora priority of a candidate mode, but is not limited thereto.

TABLE 9 index Candidate mode 0 candIntraPredModeA 1 2 +((candIntraPredModeA + 61)%64) 2 2 + ((candIntraPredModeA − 1)%64) 3 2 +((candIntraPredModeA + 60)%64) 4 2 + (candIntraPredModeA %64)

Alternatively, when candIntraPredModeA and candIntraPredModeB are notthe same and both candIntraPredModeA and candIntraPredModeB are notnondirectional modes, a second candidate group may include at least oneof candIntraPredModeA, candIntraPredModeB, (maxAB−n), (maxAB+n),(minAB−n), (minAB+n) or a nondirectional mode. Herein, maxAB and minABmay mean the maximum value and the minimum value of candIntraPredModeAand candIntraPredModeB, respectively, and n may be an integer such as 1,2, or more. The nondirectional mode may include at least one of a Planarmode or a DC mode. In an example, a candidate mode of a second candidategroup may be determined as in the following Table 10 based on adifference value (D) between candIntraPredModeA and candIntraPredModeB.

TABLE 10 Candidate Candidate Candidate Candidate mode mode mode modeIndex (D = 1) (D = 2) (D >= 62) (Otherwise) 0 candIntraPredModeAcandIntraPredModeA candIntraPredModeA candIntraPredModeA 1candIntraPredModeB candIntraPredModeB candIntraPredModeBcandIntraPredModeB 2 2 + ((minAB + 61)%64) 2 + ((minAB − 1)%64) 2 +((minAB − 1)%64) 2 + ((minAB + 61)%64) 3 2 + ((maxAB − 1)%64) 2 +((minAB + 61)%64) 2 + ((maxAB + 61)%64) 2 + ((minAB − 1)%64) 4 2 +((minAB + 60)%64) 2 + ((maxAB − 1)%64) 2 + (minAB%64) 2 + ((maxAB +61)%64)

Alternatively, when candIntraPredModeA and candIntraPredModeB are notthe same and only any one of candIntraPredModeA and candIntraPredModeBis a nondirectional mode, a second candidate group may include at leastone of maxAB, (maxAB-n), (maxAB+n) or a nondirectional mode. Herein,maxAB may mean the maximum value of candIntraPredModeA andcandIntraPredModeB and n may be an integer such as 1, 2, more. Thenondirectional mode may include at least one of a Planar mode or a DCmode. In an example, a candidate mode of a second candidate group may bedetermined as in the following Table 11. An index in Table 11 specifiesa position or a priority of a candidate mode, but is not limitedthereto.

TABLE 11 index Candidate mode 0 maxAB 1 2 + ((maxAB + 61)%64) 2 2 +((maxAB − 1)%64) 3 2 + ((maxAB + 60)%64) 4 2 + (maxAB %64)

Alternatively, when candIntraPredModeA and candIntraPredModeB are notthe same and both candIntraPredModeA and candIntraPredModeB arenondirectional modes, a second candidate group may include at least oneof a nondirectional mode, a vertical mode, a horizontal mode, (avertical mode−m), (a vertical mode+m), (a horizontal mode−m) or (ahorizontal mode+m). Herein, m may be an integer such as 1, 2, 3, 4, ormore. The nondirectional mode may include at least one of a Planar modeor a DC mode. In an example, a candidate mode of a second candidategroup may be determined as in the following Table 12. An index in Table12 specifies a position or a priority of a candidate mode, but is notlimited thereto. For example, an index 1 may be assigned to a horizontalmode or the largest index may be assigned. In addition, a candidate modemay include at least one of a diagonal mode (e.g., a mode 2, a mode 34,a mode 66), (a diagonal mode−m) or (a diagonal mode+m).

TABLE 12 Index Candidate mode 0 INTRA_DC 1 Vertical Mode 2 HorizontalMode 3 (Vertical Mode − 4) 4 (Vertical Mode + 4)

As described above, a second candidate group may include a plurality ofcandidate modes. First remaining mode information specifying any one ofa plurality of candidate modes may be signaled. A candidate modespecified by signaled first remaining mode information may be set as anintra prediction mode of a current block. Alternatively, when first andsecond candidate groups are not used, second remaining mode informationmay be signaled. Second remaining mode information may specify any oneof remaining modes other than candidate modes belonging to first andsecond candidate groups among intra prediction modes which arepredefined in an encoding/decoding device. A candidate mode specified bysecond remaining mode information may be set as an intra prediction modeof a current block.

A method of determining the above-described second candidate group willbe described by referring to FIGS. 4A-4B and 5.

The remaining mode information may be encoded based on remaining modesother than a second candidate group among the non-MPM or may be encodedbased on a non-MPM that at least one of a second candidate group or athird candidate group is rearranged, which will be described byreferring to FIGS. 6 and 7.

In reference to FIG. 3, a reference region for intra prediction of acurrent block may be determined 5310.

The reference region may mean a peripheral region which is spatiallyadjacent to a current block and a pre-reconstructed region before acurrent block. The reference region may include one or more referencelines. For example, a reference region may include at least one of afirst reference line, a second reference line, a third reference line ora fourth reference line. Herein, a first reference line may mean areference line adjacent to the left and/or the top of a current blockand a second reference line may mean a reference line adjacent to theleft and/or the top of a first reference line. A third reference linemay mean a reference line adjacent to the left and/or the top of asecond reference line and a fourth reference line may mean a referenceline adjacent to the left and/or the top of a third reference line.

A current block may be intra-predicted by using the predetermined numberof reference lines. The number of reference lines 1) may be the fixednumber which is pre-promised in an encoding/decoding device or 2) may bethe number derived in a decoding device based on an encoding parameteror 3) information on the number may be encoded and signaled in anencoding device. The number may be determined by using any one of theabove-described embodiments 1) to 3) or may be derived based on acombination of at least two of embodiments 1) to 3). The number of thedetermined reference lines may be 0, 1, 2, 3, 4, or more.

The encoding parameter may include information on a block attribute,which is the same as described above. Herein, a block attribute may meana position, a size, a shape, a ratio of a width and a height, a lengthvalue of a width and a height, a partitioning method, a partitioningdepth, a value of an intra prediction mode, whether an intra predictionmode is a directional mode, an angle of an intra prediction mode, acomponent type (luma, chroma), etc.

In an example, whether a current block is located on a boundary in animage may be considered. Herein, a boundary may mean a boundary betweenpartial images and a partial image may be a slice, a tile, a CTU row, aCTU, etc. as described above. If a current block is in contact with aboundary in an image, it may be restricted so that a top referenceregion of a current block includes only p reference lines.

In an example, the number of reference lines may be determined based ona comparison between an intra prediction mode of a current block and apredetermined first threshold value. For example, when an intraprediction mode of a current block is less than a predetermined firstthreshold value, p reference lines may be used and when an intraprediction mode of a current block is greater than or equal to apredetermined first threshold value, q reference lines may be used. Thecomparison may be a comparison with a mode value or a comparison with anangle of an intra prediction mode. The first threshold value may be apredefined value in an encoding/decoding device. For example, a firstthreshold value may mean information on at least one of a planar mode, aDC mode, a vertical mode, or a horizontal mode.

In an example, the number of reference lines may be determined based ona length value of a width and a height of a current block. For example,when a width of a current block is greater than a height, a topreference region may include q reference lines and a left referenceregion may include p reference lines. Alternatively, when a width of acurrent block is greater than a predetermined second threshold value, atop reference region may include q reference lines and otherwise, a topreference region may include p reference lines. The above-described pmay be 0, 1 or 2 and q may be 1, 2, 3 or 4. p may be less than q.

A current block may perform intra prediction by selecting one or morereference lines of the above-described first to fourth reference lines.In this case, a position of a reference line 1) may be a pre-promisedposition in an encoding/decoding device, or 2) may be derived from adecoding device based on number information of the above-describedreference lines, or 3) information specifying a position of a referenceline (mrl_idx) may be encoded in an encoding device and signaled. Theinformation (mrl_idx) may be signaled by considering at least one ofnumber information of reference lines or information on theabove-described block attributes. The position may be determined byusing any one of the above-described embodiments 1) to 3) or may bedetermined based on a combination of at least two of embodiments 1) to3).

There may be a case in which a reference line is unavailable for intraprediction of a current block. The unavailable case may mean 1) a casein which a reference line does not exist at a corresponding position, 2)a case in which a reference line is positioned in a partial imagedifferent from a current block, 3) a case in which a reference line at acorresponding position has a coding order after a current block.

When a reference line is unavailable, a reference line at acorresponding position may be excluded from a reference region.Alternatively, an unavailable reference line may be substituted by usingan available reference line. Herein, an available reference line mayinclude a peripheral sample of an unavailable reference line, aperipheral sample of a current block, etc. Herein, a peripheral samplemay mean a sample neighboring at least one of a left, right, top, bottomor diagonal direction.

In reference to FIG. 3, intra prediction for a current block may beperformed by using an intra prediction mode of a current block and areference region 5320.

FIGS. 4A-4B to 5 show a method in which a second candidate group isdetermined as an embodiment to which the present disclosure is applied.

A second candidate group may be determined by an operation whichsubtracts/adds a predetermined value of m from/to a MPM (embodiment 1).The operation may be performed for a plurality of MPM, respectively. Itmay be restricted so that the operation is not performed for a planarmode or a DC mode among the MPM. Herein, a value of m may be an integersuch as 2, 3, 4, or more. The value of m may be greater than a value ofn mentioned in FIG. 3.

The above-described subtraction/addition operation may be performedbased on a result of comparison between a mode value of a MPM and a basemode value. A base mode value may mean mode 2, mode 18 (a horizontalmode), mode 34 (a diagonal mode), mode 50 (a vertical mode) or mode 66.In this description, mode A may mean an intra prediction mode having amode value of A.

For example, when a mode value of a MPM is greater than or equal to abase mode value, an operation which subtracts a predetermined value of mfrom a MPM may be performed and otherwise, an operation which adds apredetermined value of m to a MPM may be performed. Conversely, when amode value of a MPM is greater than or equal to a base mode value, anoperation which adds a predetermined value of m to a MPM may beperformed and otherwise, an operation which subtracts a predeterminedvalue of m from a MPM may be performed.

Meanwhile, i base mode values may be used. Herein, a value of i may be1, 2, 3, 4, or 5. For example, when a value of i is 2, base mode valuesmay include a first base mode value and a second base mode value. Inthis case, a first base mode value may be any one of the above-described5 modes and a second base mode value may be another of 5 modes.

In an example, in reference to FIG. 4A, a second candidate group mayinclude a mode corresponding to a value which subtracts 32 from a modevalue of a MPM when a MPM is greater than mode 34. In reference to FIG.4B, a second candidate group may include mode 2 and mode 66 when a MPMis mode 34. A second candidate group may include a mode corresponding toa value which adds 32 to a mode value of a MPM when a MPM is less thanmode 34.

In addition to a mode derived based on a MPM, a second candidate groupmay further include its neighboring mode (embodiment 2). A neighboringmode may be determined by adding or subtracting an integer such as 1, 2,3, or more to or from a mode derived based on a MPM.

A second candidate group may be also determined based on a position of aregion to which a MPM belongs (embodiment 3). Predefined intraprediction modes in an encoding/decoding device may be classified into aplurality of regions. For convenience of description, FIG. 5 shows thatpredefined intra prediction modes are classified into 4 regions.

In reference to FIG. 5, a first region (R1) may include mode 2 to mode17, a second region (R2) may include mode 18 to mode 33, a third region(R3) may include mode 34 to mode 49 and a fourth region (R4) may includemode 50 to mode 66.

A second candidate group may be determined based on an intra predictionmode of a region adjacent to a region to which a MPM belongs. Forexample, when a MPM belongs to a first region, a second candidate groupmay be determined from at least one of a second region or a fourthregion. In this case, a second candidate group may be determined basedon the minimum value, the maximum value, a center value or a base modevalue of intra prediction modes belonging to the corresponding region.

Alternatively, a second candidate group may be determined based on anintra prediction mode of a region non-adjacent to a region to which aMPM belongs. For example, when a MPM belongs to a second region, asecond candidate group may be determined from a fourth region.Alternatively, when a MPM belongs to a third region, a second candidategroup may be determined from a first region. In this case, a secondcandidate group may be determined based on the minimum value, themaximum value, a center value or a base mode value of intra predictionmodes belonging to the corresponding region.

A second candidate group may be determined based on at least one of theabove-described embodiments 1) to 3) or may be determined based on acombination of at least two of embodiments 1 to 3.

Meanwhile, the above-determined second candidate group may include amode overlapped with the above-determined MPM. A mode overlapped withthe MPM may be removed from a second candidate group. As a result of theremoval, the number of intra prediction modes belonging to a secondcandidate group may be less than the maximum number of a secondcandidate group (MaxNumNonMPM). In this case, an intra prediction modeaccording to the above-described embodiment 2 or 3 may be added to asecond candidate group. The addition may be repeatably performed untilthe number of intra prediction modes belonging to a second candidategroup is the same as MaxNumNonMPM. The MaxNumNonMPM may be the fixednumber which is pre-promised in an encoding/decoding device or may bevariably determined based on the number of MPM belonging to a candidatemode list.

FIG. 6 relates to a method in which remaining mode information isencoded/decoded based on removal of a second candidate group as anembodiment to which the present disclosure is applied.

An encoding device may encode remaining mode information based onremaining modes (a third candidate group) other than a second candidategroup among the non-MPM.

In the encoding, remaining mode information may be encoded based on atruncated binary coding method. For convenience of description, it isassumed that 67 intra prediction modes and 6 MPM are used.

In reference to FIG. 6, when the number of a second candidate group is4, the number of a third candidate group is 57. In a third candidategroup, an intra prediction mode having an index of 0˜6 may be encodedwith 5 bits and an intra prediction mode having an index of 7˜56 may beencoded with 6 bits.

Input Offset Truncated value Offset value Binary 5-bits 0 0 0 00000

1 0 1 00001 2 0 2 00010 {open oversize bracket} 3 0 3 00011 4 0 4 001005 0 5 00101 6 0 6 00110 7 7 14 001110 8 7 15 001111 • • • 6-bits {openoversize bracket} 53 7 60 111100

54 7 61 111101 55 7 62 111110 56 7 63 111111

Alternatively, when the number of a second candidate group is 5, thenumber of a third candidate group is 56. In a third candidate group, anintra prediction mode having an index of 0˜7 may be encoded with 5 bitsand an intra prediction mode having an index of 8˜55 may be encoded with6 bits.

Input Offset Truncated value Offset value Binary 5-bits 0 0 0 00000

1 0 1 00001 2 0 2 00010 {open oversize bracket} 3 0 3 00011 4 0 4 00100• • • 6-bits 7 0 7 00111

8 8 16 010000 9 8 17 010001 • • • {open oversize bracket} 52 8 60 11110053 8 61 111101 54 8 62 111110 55 8 63 111111

Alternatively, when the number of a second candidate group is 13, thenumber of a third candidate group is 48. In a third candidate group, anintra prediction mode having an index of 0˜15 may be encoded with 5 bitsand an intra prediction mode having an index of 16˜47 may be encodedwith 6 bits.

Input Offset Truncated value Offset value Binary 5-bits 0 0 0 00000

1 0 1 00001 2 0 2 00010 {open oversize bracket} 3 0 3 00011 4 0 4 00100• • • 6-bits 15 0 15 01111

16 16 32 100000 17 16 33 100001 • • • {open oversize bracket} 44 16 60111100 45 16 61 111101 46 16 62 111110 47 16 63 111111

But, the above-described embodiment is just an example, and the numberof bits and the number of intra prediction modes encoded with 5 bits/6bits may be variably determined based on at least one of the number ofpredefined intra prediction modes, the number of MPM or the number of asecond candidate group. In addition, remaining mode information may beencoded based on FLC (fixed length code), VLC (variable length code),etc.

A decoding device may obtain remaining mode information through abitstream.

A decoding device may rearrange MPM in a candidate mode list in anascending order. The rearranged MPM may be compared with remaining modeinformation. As a result of the comparison, when remaining modeinformation is greater than or equal to the MPM, a first process whichadds 1 to remaining mode information may be performed. The first processmay be sequentially performed for each of rearranged MPM. In addition, asecond candidate group belonging to a first group of the non-MPM may berearranged in an ascending order. A rearranged second candidate groupmay be compared with a mode value obtained through the first process. Asa result of the comparison, when a mode value is greater than or equalto a second candidate group, a second process which adds 1 to a modevalue may be performed. The second process may be sequentially performedfor each of the rearranged second candidate group. A decoding device mayset a mode value obtained through the first process and second processas an intra prediction mode of a current block.

Alternatively, a decoding device may generate one list by combining acandidate mode list and a first group of the non-MPM. The generated listmay be configured with intra prediction modes including the MPM and thesecond candidate group and may be rearranged in an ascending order. Arearranged intra prediction mode may be compared with remaining modeinformation. As a result of the comparison, when remaining modeinformation is greater than or equal to a rearranged intra predictionmode, a process which adds 1 to remaining mode information may beperformed. The process may be sequentially performed for each ofrearranged intra prediction modes. A decoding device may set a modevalue obtained through the process as an intra prediction mode of acurrent block.

FIG. 7 relates to a method in which remaining mode information isencoded/decoded based on rearrangement of a second candidate group as anembodiment to which the present disclosure is applied.

An encoding device may encode remaining mode information based onremaining modes (non-MPM) other than MPM among the predefined intraprediction modes. An encoding device may rearrange a second candidategroup of the non-MPM list at a predetermined position and encoderemaining mode information based on a rearranged non-MPM list. Theposition may be a pre-promised position in an encoding/decoding device.

In reference to FIG. 7, a second candidate group may be rearranged to bepositioned behind a third candidate group. Through it, an intraprediction mode corresponding to a second candidate group may be encodedwith a codeword which is longer than a third candidate group.

Alternatively, a second candidate group may be rearranged to bepositioned before a third candidate group. Through it, an intraprediction mode corresponding to a second candidate group may be encodedwith a codeword which is shorter than a third candidate group. In otherwords, an intra prediction mode corresponding to a second candidategroup may be encoded with a short codeword and a third candidate groupmay be encoded with a relatively long codeword.

In the above-described embodiment, only some of a third candidate groupmay be selectively arranged before or behind a second candidate group.For example, some of the third candidate group may mean a mode whosemode value is an even number or may mean a mode whose mode value is anodd number among intra prediction modes included in a third candidategroup.

Alternatively, some of the third candidate group may mean a mode whosemode value is a multiple of k among intra prediction modes included in athird candidate group. Herein, k may be an integer such as 2, 3, 4, 5,or more. In the present disclosure, it is disclosed that some of a thirdcandidate group is selected based on a mode value of an intra predictionmode belonging to a third candidate group, but it is just an example.For example, a third candidate group may be grouped with i intraprediction modes. Some of a third candidate group may be determined byselecting at least one intra prediction mode in each group. Herein, imay be an integer such as 2, 3, 4, 5, 6, or more. An intra predictionmode corresponding to the minimum value, the maximum value or a centervalue among modes belonging to each group may be selected.Alternatively, some of a third candidate group may be determined basedon a result of comparison between an intra prediction mode of a thirdcandidate group and an intra prediction mode of a second candidate group(or, an intra prediction mode of the MPM). For example, a mode whichsatisfies that a difference between the mode values is less than orequal to a predetermined threshold value may be selected.

Alternatively, the non-MPM may be rearranged/reconfigured to includeonly a second candidate group by removing remaining modes (i.e., a thirdcandidate group) other than a second candidate group from the non-MPM.As a third candidate group is not used, the number of intra predictionmodes belonging to the non-MPM list may be reduced and a secondcandidate group may be encoded with a shorter codeword.

A decoding device may obtain remaining mode information through abitstream. An intra prediction mode of a current block may be decodedbased on the remaining mode information. The decoding may be performedbased on at least one of the number of the second candidate group, anarrangement position of a second candidate group within the non-MPM or avalue of remaining mode information. Also, the decoding may furtherinclude a process in which the MPM/the second candidate group arearranged in an ascending order and compared as shown in FIG. 6.

In an example, it is assumed that the number of the second candidategroup is 5 and a second candidate group is positioned behind a thirdcandidate group.

If the remaining mode information has a value of 56 to 60, a decodingdevice may determine an intra prediction mode corresponding to a valueof the remaining mode information. The determined intra prediction modemay be set as an intra prediction mode of a current block.

On the other hand, when the remaining mode information has a value of 0to 55, a decoding device may rearrange MPM in a candidate mode list inan ascending order. The rearranged MPM may be compared with remainingmode information. As a result of the comparison, when remaining modeinformation is greater than or equal to the MPM, a first process whichadds 1 to remaining mode information may be performed. The first processmay be sequentially performed for each of rearranged MPM. In addition, asecond candidate group belonging to a first group of the non-MPM may berearranged in an ascending order. A rearranged second candidate groupmay be compared with a mode value obtained through the first process. Asa result of the comparison, when a mode value is greater than or equalto a second candidate group, a second process which adds 1 to a modevalue may be performed. The second process may be sequentially performedfor each of the rearranged second candidate group. A decoding device mayset a mode value obtained through the first process and second processas an intra prediction mode of a current block.

Alternatively, a decoding device may generate one list by combining acandidate mode list and a first group of the non-MPM. The generated listmay be configured with intra prediction modes including the MPM and thesecond candidate group and may be rearranged in an ascending order. Arearranged intra prediction mode may be compared with remaining modeinformation. As a result of the comparison, when remaining modeinformation is greater than or equal to a rearranged intra predictionmode, a process which adds 1 to remaining mode information may beperformed. The process may be sequentially performed for each ofrearranged intra prediction modes. A decoding device may set a modevalue obtained through the process as an intra prediction mode of acurrent block.

In an example, it is assumed that the number of a second candidate groupis 5 and a second candidate group is positioned before a third candidategroup.

When the remaining mode information has a value of 0 to 4, a decodingdevice may determine an intra prediction mode corresponding to a valueof remaining mode information among a second candidate group. Thedetermined intra prediction mode may be set as an intra prediction modeof a current block.

On the other hand, when the remaining mode information has a value of 5to 60, a decoding device may rearrange the MPM of a candidate mode listin an ascending order. The rearranged MPM may be compared with remainingmode information. As a result of the comparison, when remaining modeinformation is greater than or equal to the MPM, a first process whichadds 1 to remaining mode information may be performed. The first processmay be sequentially performed for each of rearranged MPM. In addition, asecond candidate group belonging to a first group of the non-MPM may berearranged in an ascending order. A rearranged second candidate groupmay be compared with a mode value obtained through the first process. Asa result of the comparison, when a mode value is greater than or equalto a second candidate group, a second process which adds 1 to a modevalue may be performed. The second process may be sequentially performedfor each of the rearranged second candidate group. A decoding device mayset a mode value obtained through the first process and second processas an intra prediction mode of a current block.

Alternatively, a decoding device may generate one list by combining acandidate mode list and a first group of the non-MPM. The generated listmay be configured with intra prediction modes including the MPM and thesecond candidate group and may be rearranged in an ascending order. Arearranged intra prediction mode may be compared with remaining modeinformation. As a result of the comparison, when remaining modeinformation is greater than or equal to a rearranged intra predictionmode, a process which adds 1 to remaining mode information may beperformed. The process may be sequentially performed for each ofrearranged intra prediction modes. A decoding device may set a modevalue obtained through the process as an intra prediction mode of acurrent block.

Illustrative methods of the present disclosure are represented as motionseries for clarity of description, but it is not to limit an order thata stage is performed and if necessary, each stage may be performedsimultaneously or in a different order. To implement a method accordingto the present disclosure, other stage may be additionally included inan illustrative stage, or remaining stages may be included except forsome stages, or an additional other stage may be included except forsome stages.

A variety of embodiments of the present disclosure do not enumerate allpossible combinations, but are to describe the representative aspect ofthe present disclosure and matters described in various embodiments maybe independently applied or may be applied by two or more combinations.

In addition, a variety of embodiments of the present disclosure may beimplemented by a hardware, a firmware, a software, or their combination,etc. For implementation by a hardware, implementation may be performedby one or more ASICs (Application Specific Integrated Circuits), DSPs(Digital Signal Processors), DSPDs (Digital Signal Processing Devices),PLDs (Programmable Logic Devices), FPGAs (Field Programmable GateArrays), general processors, controllers, microcontrollers,microprocessors, etc.

A range of the present disclosure includes software ormachine-executable instructions (e.g., an operating system, anapplication, a firmware, a program, etc.) which execute an actionaccording to a method of various embodiments in a device or a computerand a non-transitory computer-readable medium that such software orinstructions, etc. are stored and are executable in a device or acomputer.

INDUSTRIAL APPLICABILITY

The present disclosure may be used for encoding/decoding a video signal.

What is claimed is:
 1. A video decoding method, comprising: obtaining a flag from a bitstream, the flag indicating a predetermined candidate group used to derive an intra prediction mode of a current block; determining a candidate group on the intra prediction mode of the current block based on the flag; deriving the intra prediction mode of the current block based on the determined candidate group; and performing intra prediction for the current block based on the derived intra prediction mode and a predetermined reference region, wherein the candidate group is determined as a first candidate group or a second candidate group, wherein the first candidate group is configured with a default mode, and wherein the second candidate group is configured by using an intra prediction mode of a neighboring block adjacent to the current block.
 2. The method of claim 1, wherein the default mode includes at least one of a DC mode or a Planar mode.
 3. The method of claim 1, wherein at least one candidate mode belonging to the second candidate group is derived by adding or subtracting a value of n to or from the intra prediction mode of the neighboring block, and wherein n is a natural number greater than or equal to
 2. 4. The method of claim 3, wherein a number of candidate modes belonging to the second candidate group is
 5. 5. The method of claim 4, wherein the second candidate group does not include the default mode included in the first group.
 6. A video encoding method, comprising: determining an intra prediction mode of a current block; encoding a flag for indicating a candidate group to which the intra prediction mode of the current block belongs; and performing intra prediction for the current block based on the intra prediction mode of the current block and a predetermined reference region, wherein the candidate group includes at least one of a first candidate group or a second candidate group, wherein the first candidate group is configured with a default mode, and wherein the second candidate group is configured by using an intra prediction mode of a neighboring block adjacent to the current block.
 7. The method of claim 6, wherein the default mode includes at least one of a DC mode or a Planar mode.
 8. The method of claim 6, wherein at least one candidate mode belonging to the second candidate group is derived by adding or subtracting a value of n to or from the intra prediction mode of the neighboring block, and wherein n is a natural number greater than or equal to
 2. 9. The method of claim 8, wherein a number of candidate modes belonging to the second candidate group is
 5. 10. The method of claim 9, wherein the second candidate group does not include the default mode included in the first group.
 11. A computer readable recording medium for storing data related to a video signal, comprising: a data stream including encoding information encoded by intra prediction of a current block, wherein the encoding information includes a flag indicating a candidate group used to derive an intra prediction mode of the current block, wherein according to the flag, the candidate group on the intra prediction mode of the current block is determined as any one of a first candidate group or a second candidate group, wherein the first candidate group is configured with a default mode, and wherein the second candidate group is configured by using an intra prediction mode of a neighboring block adjacent to the current block.
 12. The method of claim 11, wherein the default mode includes at least one of a DC mode or a Planar mode.
 13. The method of claim 11, wherein at least one candidate mode belonging to the second candidate group is derived by adding or subtracting a value of n to or from the intra prediction mode of the neighboring block, and wherein n is a natural number greater than or equal to
 2. 14. The method of claim 13, wherein a number of candidate modes belonging to the second candidate group is
 5. 15. The method of claim 14, wherein the second candidate group does not include the default mode included in the first group. 